﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;

/// <summary>
///ConDB 的摘要说明
/// </summary>
public class ConDB
{
	public ConDB()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
	}
    private static SqlConnection con = new SqlConnection();
    public static SqlConnection GetOpen()
    {
        try
        {
            if (con.State == ConnectionState.Closed)
            {
                con.ConnectionString = ConfigurationManager.ConnectionStrings["DB_CCXYRCConnectionString"].ConnectionString;
                con.Open();
            }
            return con;
        }
        catch (Exception ee)
        {

            return null;
        }
    }
    public static void Close()
    {
        if (con.State != ConnectionState.Closed){
        con.Close();
    }
    }
}
